import { defineConfig } from 'vite';
import path from 'path';

export default defineConfig({
  build: {
    outDir: 'dist/scripts',
    lib: {
      entry: {
        'simple-crawler': path.resolve(__dirname, 'scripts/simple-crawler.ts'),
      },
      formats: ['cjs'],
      fileName: (format, entryName) => `${entryName}.cjs`,
    },
    rollupOptions: {
      external: [
        'node:path',
        'node:fs',
        'node:process',
        /^node-cron/,
        /^@prisma/,
      ],
    },
    minify: true,
    sourcemap: true,
  },
  publicDir: false,
}); 